package net.zrnecko.km.entity;



import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

/**
 * @author zrnecko
 *
 */
@Entity
@NamedQueries( {
		@NamedQuery(name = "findAllPlayers", query = "select from Player p"),
		@NamedQuery(name = "findPlayerByPlayerId", query = "select from Player p where p.playerId = :playerId") })
public class Player implements Serializable {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	private int PlayerId;
	
	private String name;
	
	@OneToMany(cascade=CascadeType.ALL)
	private List<PlayerHistoryRecord> playerHistory;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public int getPlayerId() {
		return PlayerId;
	}

	public void setPlayerId(int playerId) {
		PlayerId = playerId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<PlayerHistoryRecord> getPlayerHistory() {
		return playerHistory;
	}

	public void setPlayerHistory(List<PlayerHistoryRecord> playerHistory) {
		this.playerHistory = playerHistory;
	}
	
	
	
	
	
	

}
